﻿@model cloudscribe.Core.Web.ViewModels.SiteUser.LoginWith2faViewModel
@inject IStringLocalizer<CloudscribeCore> sr
@{
    ViewData["BodyClass"] = "account-section login-2fa";
}
<h2>@ViewData["Title"]</h2>
<hr />
<p>@sr["Your login is protected with an authenticator app. Enter your authenticator code below."]</p>

<form method="post" asp-route-returnUrl="@ViewData["ReturnUrl"]">
    <input asp-for="RememberMe" type="hidden" />
    <div asp-validation-summary="All" class="text-danger"></div>
    <div class="form-group">
        <label asp-for="TwoFactorCode"></label>
        <input asp-for="TwoFactorCode" class="form-control" autocomplete="off" />
        <span asp-validation-for="TwoFactorCode" class="invalid-feedback"></span>
    </div>
    <div class="form-group">
        <div class="form-check">
            <input asp-for="RememberMachine" class="form-check-input" />
            <label asp-for="RememberMachine" class="form-check-label">@Html.DisplayNameFor(m => m.RememberMachine)</label>
        </div>
    </div>
    <div class="form-group">
        <button type="submit" class="btn btn-primary">@sr["Log in"]</button>
    </div>
</form>

<p>
    Don't have access to your authenticator device? You can
    <a asp-action="LoginWithRecoveryCode" asp-route-returnUrl="@ViewData["ReturnUrl"]">log in with a recovery code</a>.
</p>

@section Scripts {
    <script src="~/cr/js/jquery.validate.min.js"></script>
    <script src="~/cr/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/cr/js/unobtrusive-validation-bs4.min.js"></script>
}